The development of software applications typically involves writing software code in a high-level programming language and translating the code into a lower-level machine language that can be executed by a computer system. Many so-called “compiler” applications exist to effectuate the translation from the high-level “source code” into a lower-level “executable code.” These compilers may implement many different types of functionality, for example, that enhance the efficiency of the compilation process through various compiler optimizations.
Advanced compilers can implement hundreds of optimizations that have been developed over the past few decades. However, compilers typically only apply a subset of available optimizations, and the optimizations are typically applied somewhat indiscriminately on every function or block in the file (e.g., according to fixed command line options). This can result in sub-optimal performance, for example, from incorrectly applying speculative optimizations to functions that do not need them, from applying non-speculative optimizations in a “one-size-fits-all” manner, etc. Furthermore, many speculative optimizations are often shunned during compilation, as it may be difficult for the user to instruct the compiler to perform speculative optimizations only to selected functions in a file.